package com.midea.ai.air.ui.more;

import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.midea.ai.air.R;
import com.midea.ai.air.common.BaseActivity;
import com.midea.ai.air.common.Constant;
import com.midea.ai.air.ui.more.adapter.MoreSelectedDataAdapter;
import com.midea.ai.air.ui.more.data.MoreSelectedData;
import com.midea.ai.air.view.ListViewForScrollView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hww on 2016/4/21.
 * 新建联动-启动条件-启动时间-重复
 */
public class MoreSettingBrainpowerStartCondition_StartTime_Repetition extends BaseActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_moresettingbrainpowerstartconditionstarttimerepetition);

        init();
    }

    private RelativeLayout bar_Rl;
    private LinearLayout back_left;
    private ListViewForScrollView mListView;
    private List<MoreSelectedData> mList_Datas = new ArrayList<>();


    private void init() {
        bar_Rl = (RelativeLayout) findViewById(R.id.bar_parent_rl);
        ViewGroup.LayoutParams LP = bar_Rl.getLayoutParams();
        LP.height = Constant.getTopMargin() + getResources().getDimensionPixelSize(R.dimen.height_44dp);
        bar_Rl.setLayoutParams(LP);

        back_left = (LinearLayout) findViewById(R.id.left_relativeLayout_back);
        back_left.setOnClickListener(this);


        MoreSettingBrainpowerStartCondition_StartTime.mList_Selected.clear();
        for (int i = 0; i < 7; i++) {
            MoreSettingBrainpowerStartCondition_StartTime.mList_Selected.add(false);
        }

        mListView = (ListViewForScrollView) findViewById(R.id.more_setting_brainpower_start_condition_start_time_repetition_listView);

        mList_Datas.add(new MoreSelectedData("星期日", false));
        mList_Datas.add(new MoreSelectedData("星期一", false));
        mList_Datas.add(new MoreSelectedData("星期二", false));
        mList_Datas.add(new MoreSelectedData("星期三", false));
        mList_Datas.add(new MoreSelectedData("星期四", false));
        mList_Datas.add(new MoreSelectedData("星期五", false));
        mList_Datas.add(new MoreSelectedData("星期六", false));

        mListView.setAdapter(new MoreSelectedDataAdapter(this, mList_Datas));


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.left_relativeLayout_back:
                this.finish();
                break;
            default:
                break;
        }
    }

}
